// 3. 滚动图片
{
    var msUL = document.querySelector('.miaosha-goods ul');
    var pos = 0;
    var rollTimer = null;
    
    function autoRoll () {
        rollTimer = setInterval(function () {
            if (pos == -2020) {
                pos = 0;
            }
            msUL.style.left = --pos + 'px';
        }, 50);
    }
    
    autoRoll();
    msUL.onmouseenter = function () {
        clearInterval(rollTimer);
    }

    msUL.onmouseleave = function () {
        autoRoll();
    }
}